import json
from Database.Data_connect import yueyan_database
from flask import Blueprint

# 蓝图
hf = Blueprint('hf', __name__)

# 数据库初始化
db = yueyan_database()


@hf.route('/')
def hello_world():
    # 响应：返回浏览器的数据
    return "hf!"


@hf.route('/Collage_info', methods=["GET", "POST"])
def Collage_info():
    """
    所有院校信息
    :return:
    """
    Collage = db.select_all(table_name="collage")
    return {"code": 200, "data": json.dumps(Collage, ensure_ascii=False), "msg": "succeed"}
